<script setup lang='ts'>
import { transfromToComponentProps, textDefaultProps, textStylePropNames } from '@/assets/component/defaultProps'
import { useComponentCommon } from '@/hooks/useComponentCommon'

const props = defineProps({
    tag: {
        type: String,
        default: 'div'
    },
    ...transfromToComponentProps(textDefaultProps)
})

const { styleProps, handleClick } = useComponentCommon(props, textStylePropNames)
</script>

<template>
    <!-- BUG 这个LTxt 组件写的有问题，componentsList 那里的展示。 -->
    <component class="l-text-component" :is="props.tag" :style="styleProps" @click="handleClick">{{ props.text }}
    </component>
</template>

<style scoped lang='scss'></style>